import { defineStore } from 'pinia'

export interface SidebarState {
  isCollapse: boolean
}

export const useSidebarStore = defineStore('sidebar', {
  state: (): SidebarState => ({
    isCollapse: false, // 默认展开
  }),
  actions: {
    toggleCollapse() {
      this.isCollapse = !this.isCollapse
    },
    setCollapse(collapse: boolean) {
      this.isCollapse = collapse
    },
  },
})
